SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE VIEW	[dbo].[ARTY_TO_SSB_ID_MAP] AS 

SELECT DISTINCT s.artyid, s.SSBAssetID FROM 

(SELECT 


ISNULL(slop.Asset_LOANXAssetID_Name, slop.Facility_Cusip) AS ARTYID, slop.Facility_Cusip AS SSBAssetID

FROM  

dbo.newSLOP slop

UNION ALL 

SELECT d.LoanX, d.Cusip


FROM dbo.derl d) AS s




GO
